<%@ page import="bean.UserInfo" %><%--
  Created by IntelliJ IDEA.
  User: yaclt
  Date: 2021/12/2 0002
  Time: 8:53
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>修改</title>
    <link rel="stylesheet" href="/assets/css/bootstrap.min.css">
    <style>
        .container {
            width: 1000px;
            margin-top: 20px;
        }
    </style>
</head>
<body>

<div class="container" style="width: 400px">
    <h1>修改用户</h1>
    <% UserInfo u = (UserInfo) request.getAttribute("user"); %>
    <form action="/cp7/user/modify?id=<%=u.getId()%>" method="post">
        <%-- 传递id参数可以选择？的get参数 ，也可以使用表单的hidden隐藏域 --%>
        <input type="hidden" name="id" value="<%=u.getId()%>">
        <p class="form-group">
            <input type="text" required class="form-control" name="nickname" placeholder="昵称"
                   value="<%=u.getNickname()%>">
        </p>
        <p class="form-group">
            <input type="text" required class="form-control" name="account" placeholder="账号"
                   value="<%=u.getAccount()%>">
        </p>
        <p class="form-group">
            <input type="password" class="form-control" name="password" placeholder="密码">
        </p>
        <p class="form-group">
            <input type="text" class="form-control" name="email" placeholder="邮箱"
                   value="<%=u.getEmail()==null?"":u.getEmail()%>">
        </p>
        <button type="submit" class="btn btn-primary btn-block">保存</button>
    </form>
</div>
</body>
</html>
